package com.m4f.business.model;

import java.io.Serializable;

import javax.jdo.annotations.EmbeddedOnly;
import javax.jdo.annotations.IdGeneratorStrategy;  
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;  
import javax.jdo.annotations.PrimaryKey;
import javax.jdo.annotations.IdentityType; 
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import com.google.appengine.api.datastore.Key; 

@PersistenceCapable(detachable="true")
@EmbeddedOnly
public class Participant implements Serializable {

	@Persistent
	//message = "{email.blank}"
	@NotNull(message="Mail blank")
	@Pattern(regexp = "^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$", message="Bad mail")
	private String email;
	
	@Persistent
	@NotNull(message="Bad Password")
	@Size(min=6, max=25)
	//@Min(message = "{password.error}", value=6)
	private String password;
	
	@Persistent
	@NotNull(message="You must accept condition to register into website")
	private String agreement1;
	
	@Persistent
	@NotNull(message="You must accept condition to register into website")
	private String agreement2;
	
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public void setAgreement1(String agreement1) {
		this.agreement1 = agreement1;
	}
	public String getAgreement1() {
		return agreement1;
	}
	public void setAgreement2(String agreement2) {
		this.agreement2 = agreement2;
	}
	public String getAgreement2() {
		return agreement2;
	}
	

}